This application is based on applications Nos. 10-50421, 10-50424, 10-50428 and 10-50434/1998 filed in Japan the content of which is incorporated hereinto by reference.
1. Field of the Invention
The present invention relates to an image processing apparatus for compressing digital data.
2. Description of Prior Art
In an image processing apparatus for processing digital data, input image data is once compressed and stored in a memory device. When the image is outputted, the data is read from the memory device and expanded to the original image data. In this case, a plurality of sheets of the image data are stored in the memory device in the order of the coding.
When image data are stored in a system where a plurality of sheets of image data are subjected to variable-length coding and stored in a memory device, it is desirable that code data of as many sheets as possible is stored in a limited memory size. For this purpose, there is a need for an efficient memory management technique and a random access technique for accessing a desired page in the code data of a plurality of pages stored in a compression memory. However, it is generally difficult for the variable-length coding to know the size of the coded data before the coding.
In the above-described image processing apparatus, a sequence of image data of a plurality of pages ca be efficiently stored in the memory device. However, when only the data of a specified page in a sequence of the data is erased to store new data in the erased data area, the memory device cannot be managed because the size of the code data to be written newly is not known, and the data cannot be written. Therefore, it is desirable to efficiently store image data of a plurality of pages of an unknown data size in a memory device.
An object of the present invention is to provide an image processing apparatus which can access at random a specified page in the code data of a plurality of pages and can efficiently manage a memory device in a system storing the data subjected to variable-length coding in a compression memory.
In one aspect of the present invention, an image data processor comprises an encoder which encodes image data, an attribute decider which divides the image data to be encoded data to a plurality of areas and discriminates an attribute of the image data for each of the areas, a controller which determines an amount of the image data for each of the attributes discriminated by said attribute decider and determines an amount of the encoded data obtained by said encoder based on the amounts of the image data of the attributes.
In another aspect of the invention, an image data processor comprises a first encoder provided for fixed length encoding on image data, a second encoder provided for variable length encoding on data encoded by said first encoder, a discriminator which discriminates an attribute of the image data, and a controller which controls said second encoder according to the attribute discriminated by said discriminator.
In a third aspect of the invention, an image data processor comprises a divider which divides a page of image data to a plurality of blocks, and a decision section which decides an attribute of image data for each block, wherein said decision section changes the attribute of each block according to the attribute of the entire page.
In a fourth aspect of the invention, an image data coding method comprises the steps of: deciding an attribute of image data; recognizing a capacity of encoded image data based on the attribute decided in said deciding step, and determining a write address to a memory device according to the recognized capacity, encoding the image data, and writing the data encoded in said encoding step to the determined write address.
In a fifth aspect of the invention, an image coding method comprises the steps of: deciding an attribute of image data, encoding the image data irrespective of the attribute decided in said deciding step; encoding further the image data, which have been subjected to encoding, according to the attribute decided in said deciding step, determining a capacity of the image data which have been subjected further to encoding, and determining a write address to a memory device according to the determined capacity, and writing the data, which have been encoded further, to the determined write address.
In a sixth aspect of the invention, an image coding method comprises the steps of: recognizing an attribute of image data in an entire page, recognizing an attribute of image data for each block of the image data in the entire page, and processing the image data by encoding the image data according to the attribute for each block when the attribute of the entire page is a first attribute, and processing the image data without the encoding when the attribute of the entire page is a second attribute different from the first one.
An advantage of the present invention is that a specified page of the code data in a plurality of pages ca be accessed at random in a system for compressing image data with variable-length coding.
Another advantage of the present invention is that the memory ca be efficiently managed in a system for compressing image data with variable-length coding.
A further advantage of the present invention is that the compression ratio of image data is enhanced.